Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@bugsnag/js
Advanced tools
Universal Javascript error reporting. Automatically detect JavaScript errors in the browser and Node.js, with plugins for React, Vue, Angular, Express, Restify and Koa.
@bugsnag/js is a JavaScript error monitoring and reporting tool that helps developers detect, diagnose, and resolve errors in their applications. It provides real-time error tracking, detailed error reports, and integrations with various platforms and frameworks.
Error Reporting
This feature allows you to report errors to Bugsnag. The code sample initializes Bugsnag with an API key and reports a test error.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
try {
throw new Error('Test error');
} catch (e) {
Bugsnag.notify(e);
}
Breadcrumbs
Breadcrumbs are logs of user actions or application events that lead up to an error. This code sample shows how to leave a breadcrumb when a user clicks a button.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
Bugsnag.leaveBreadcrumb('User clicked button', { buttonId: 'submit' });
Custom Metadata
You can add custom metadata to error reports for more context. This code sample demonstrates adding account information to an error report.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
Bugsnag.notify(new Error('Test error'), event => {
event.addMetadata('account', {
id: 123,
name: 'Acme Co'
});
});
Session Tracking
Session tracking helps you understand the stability of your application by tracking user sessions. This code sample shows how to start a session.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
Bugsnag.startSession();
Sentry is a popular error tracking and performance monitoring tool. It provides similar functionalities to Bugsnag, such as real-time error reporting, breadcrumbs, and custom metadata. Sentry also offers performance monitoring features that help track application performance issues.
Rollbar is another error monitoring service that provides real-time error tracking, detailed error reports, and integrations with various platforms. It offers features like error grouping, custom metadata, and breadcrumbs, similar to Bugsnag.
Airbrake is an error monitoring tool that provides real-time error tracking and detailed error reports. It offers features like error grouping, custom metadata, and breadcrumbs, similar to Bugsnag. Airbrake also integrates with various development tools and platforms.
Universal JavaScript notifier.
This package contains both @bugsnag/browser
and @bugsnag/node
and the appropriate one will be included in your application.
In Node, importing '@bugsnag/js'
will provide the @bugsnag/node
module.
In various bundlers, importing '@bugsnag/js'
will provide the @bugsnag/browser
module.
Bundler | Support |
---|---|
Browserify | Supports the package.json "browser" field by default |
Webpack | Supports the package.json "browser" field by default |
Rollup | Set browser: true in the node-resolve plugin |
Note: by using this browser-specific entrypoint, none of the node-specific code will be included in your bundle.
This package is free software released under the MIT License. See LICENSE.txt for details.
FAQs
Universal Javascript error reporting. Automatically detect JavaScript errors in the browser and Node.js, with plugins for React, Vue, Angular, Express, Restify and Koa.
The npm package @bugsnag/js receives a total of 511,863 weekly downloads. As such, @bugsnag/js popularity was classified as popular.
We found that @bugsnag/js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.